package com.jsbs.iam.auth.mapper;

import com.jsbs.iam.auth.dto.IamDynamicUserGroupAddDto;
import com.jsbs.iam.auth.dto.IamDynamicUserGroupEditDto;
import com.jsbs.iam.auth.param.IamQueryDynamicUserGroupBeforeParam;
import com.jsbs.iam.auth.param.IamQueryStaticUserGroupParam;
import com.jsbs.iam.auth.vo.IamDynamicUserGroupVo;
import com.jsbs.iam.auth.vo.IamUserGroupVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ClassName: DynamicUserGroupManagerMapper
 * @Author: tenghuawei
 * @Date: 2023/1/6 10:30
 * @Description: 动态用户组管理
 */

@Mapper
@Repository
public interface IamDynamicUserGroupManagerMapper {

    /**
     * 功能描述：获取动态用户组编码当前最大值
     * @param
     * @return Integer
     */
    Integer getMaxDynamicUserGroupCode();

    /**
     * 功能描述：校验动态用户组的组名的唯一性
     * @param
     * @return int
     */
    int checkDynamicUserGroupName (@Param("userGroupName") String userGroupName,
                                   @Param("companyCode")String companyCode);

    /**
     * 功能描述：根据用户组编码、租户查用户组名
     * @param
     * @return int
     */
    String queryDynamicUserGroupName (@Param("companyCode")String companyCode,
                                      @Param("userGroupCode")String userGroupCode,
                                      @Param("adminRoleCode")String adminRoleCode);

    /**
     * 功能描述：查询动态用户组
     * @param iamQueryStaticUserGroupParam
     * @return List
     */
    List<IamUserGroupVo> queryDynamicUserGroup(@Param("iamQueryStaticUserGroupParam") IamQueryStaticUserGroupParam iamQueryStaticUserGroupParam);

    /**
     * 功能描述：新增动态用户组
     * @param iamDynamicUserGroupAddDto
     * @return int
     */
    int createDynamicUserGroup (@Param("iamDynamicUserGroupAddDto") IamDynamicUserGroupAddDto iamDynamicUserGroupAddDto);

    /**
     * 功能描述：编辑动态用户组时，查询展示之前的数据-
     * @param iamQueryDynamicUserGroupBeforeParam
     * @return IamDynamicUserGroupVo
     */
    IamDynamicUserGroupVo queryDynamicUserGroupEditBefore(@Param("iamQueryDynamicUserGroupBeforeParam") IamQueryDynamicUserGroupBeforeParam iamQueryDynamicUserGroupBeforeParam);

    /**
     * 功能描述：编辑动态用户组
     * @param iamDynamicUserGroupEditDto
     * @return int
     */
    int userGroupEdit(@Param("iamDynamicUserGroupEditDto") IamDynamicUserGroupEditDto iamDynamicUserGroupEditDto);




}
